<!--
 * @Author: wangzhichiao<https://github.com/wzc570738205>
 * @Date: 2020-05-25 14:58:08
 * @LastEditors: wangzhichiao<https://github.com/wzc570738205>
 * @LastEditTime: 2020-05-29 10:30:24
 -->
<template>
  <el-table
    v-loading="loading"
    :data="tableData"
    stripe
    @selection-change="(selection) => $emit('selection-change', selection)"
  >
    <el-table-column type="selection" align="center" />
    <el-table-column prop="formName" label="表单名称" />
    <el-table-column prop="code" label="表单编码" />
    <el-table-column prop="description" label="表单描述" />
    <el-table-column prop="createTime" label="创建时间" />
    <el-table-column label="操作" width="100">
      <template slot-scope="scope">
        <el-button
          plain
          type="primary"
          @click="$emit('form-design-click', scope.row)"
        >表单设计</el-button>
      </template>
    </el-table-column>
  </el-table>
</template>

<script>
export default {
  props: {
    tableData: {
      type: Array,
      required: true,
      default: () => []
    },
    loading: {
      type: Boolean,
      required: true,
      default: () => false
    }
  }
}
</script>

<style lang="stylus" scoped>
.el-table
  margin-top 20px
</style>
